package com.ruoyi.jkcrData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.jkcrData.domain.plat.DataJkcrZhdl;
import com.ruoyi.jkcrData.mapper.DataJkcrZhdlMapper;
import com.ruoyi.jkcrData.service.IDataJkcrZhdlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 架空乘人制动力测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-19
 */
@Service
public class DataJkcrZhdlServiceImpl implements IDataJkcrZhdlService
{
    @Autowired(required = false)
    private DataJkcrZhdlMapper dataJkcrZhdlMapper;

    /**
     * 查询架空乘人制动力测试数据
     * 
     * @param zhdlId 架空乘人制动力测试数据主键
     * @return 架空乘人制动力测试数据
     */
    @Override
    public DataJkcrZhdl selectDataJkcrZhdlByZhdlId(Long zhdlId)
    {
        return dataJkcrZhdlMapper.selectDataJkcrZhdlByZhdlId(zhdlId);
    }

    /**
     * 根据dataTaskId获取数据
     *
     * @param dataTaskId
     */
    @Override
    public Future<List<DataJkcrZhdl>> selectDataJkcrZhdlByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataJkcrZhdlMapper.selectDataJkcrZhdlByDataTaskId(dataTaskId));
    }

    /**
     * 查询架空乘人制动力测试数据列表
     * 
     * @param dataJkcrZhdl 架空乘人制动力测试数据
     * @return 架空乘人制动力测试数据
     */
    @Override
    public List<DataJkcrZhdl> selectDataJkcrZhdlList(DataJkcrZhdl dataJkcrZhdl)
    {
        return dataJkcrZhdlMapper.selectDataJkcrZhdlList(dataJkcrZhdl);
    }

    /**
     * 新增架空乘人制动力测试数据
     * 
     * @param dataJkcrZhdl 架空乘人制动力测试数据
     * @return 结果
     */
    @Override
    public int insertDataJkcrZhdl(DataJkcrZhdl dataJkcrZhdl)
    {
        dataJkcrZhdl.setCreateTime(DateUtils.getNowDate());
        return dataJkcrZhdlMapper.insertDataJkcrZhdl(dataJkcrZhdl);
    }

    /**
     * 批量新增架空乘人制动力测试数据
     *
     * @param dataJkcrZhdl
     */
    @Override
    public int batchDataJkcrZhdl(List<DataJkcrZhdl> dataJkcrZhdl) {
        return dataJkcrZhdlMapper.batchDataJkcrZhdl(dataJkcrZhdl);
    }

    /**
     * 修改架空乘人制动力测试数据
     * 
     * @param dataJkcrZhdl 架空乘人制动力测试数据
     * @return 结果
     */
    @Override
    public int updateDataJkcrZhdl(DataJkcrZhdl dataJkcrZhdl)
    {
        dataJkcrZhdl.setUpdateTime(DateUtils.getNowDate());
        return dataJkcrZhdlMapper.updateDataJkcrZhdl(dataJkcrZhdl);
    }

    /**
     * 变更数据状态
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataJkcrZhdlByDataTaskId(Long dataTaskId) {
        return dataJkcrZhdlMapper.updateDataJkcrZhdlByDataTaskId(dataTaskId);
    }

    /**
     * 变更数据状态
     *
     * @param zhdlId
     * @return 结果
     */
    @Override
    public int updateDataJkcrZhdlByZhdlId(Long zhdlId) {
        return dataJkcrZhdlMapper.updateDataJkcrZhdlByZhdlId(zhdlId);
    }

    /**
     * 批量删除架空乘人制动力测试数据
     * 
     * @param zhdlIds 需要删除的架空乘人制动力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataJkcrZhdlByZhdlIds(Long[] zhdlIds)
    {
        return dataJkcrZhdlMapper.deleteDataJkcrZhdlByZhdlIds(zhdlIds);
    }

    /**
     * 删除架空乘人制动力测试数据信息
     * 
     * @param zhdlId 架空乘人制动力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataJkcrZhdlByZhdlId(Long zhdlId)
    {
        return dataJkcrZhdlMapper.deleteDataJkcrZhdlByZhdlId(zhdlId);
    }
}
